import { Component, OnInit } from '@angular/core';
import { Router } from "@angular/router";

import { HttpRouter } from '../service/httpRouter'
import { HttpService } from '../service/httpService'

@Component({
  selector: 'app-cardlistlocal',
  templateUrl: './cardlistlocal.component.html',
  styleUrls: ['./cardlistlocal.component.less']
})
export class CardlistlocalComponent implements OnInit {

  private cardlist : any[];
  private title = "我的孩子";
  private defaultHead = '../../assets/dog.png';
  constructor(
    private httpRouter : HttpRouter,
    private httpService : HttpService,
    public router : Router
  ) { }

  ngOnInit() {
    this.getList();

  }
  getList(){
    this.httpService.get(this.httpRouter.getChildListUrl).subscribe(data => {
      if(data.code === "10200"){
        this.cardlist = data.data;
      }
    });
  }

  getCourses(childId){
    window.location.href="http://assessment.winnovator.cn/render.html";
  }

}
